package com.yang.leather.common.hibernate;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import com.yang.leather.common.page.Pagination;


public interface BaseManager<T extends Serializable> {
	public T findById(Serializable id);

	public T load(Serializable id);

	public List<T> findAll();

	public Pagination findAll(int pageNo, int pageSize, OrderBy... orderBys);

	public List<T> findByEgList(T eg, boolean anyWhere, Condition[] conds,
			String... exclude);

	public List<T> findByEgList(T eg, boolean anyWhere, String... exclude);

	public List<T> findByEgList(T eg, Condition[] conds, String... exclude);

	public List<T> findByEgList(T eg, boolean anyWhere, Condition[] conds,
			int firstResult, int maxResult, String... exclude);

	public List<T> findByEgList(T eg, boolean anyWhere, int firstResult,
			int maxResult, String... exclude);

	public List<T> findByEgList(T eg, Condition[] conds, int firstResult,
			int maxResult, String... exclude);

	public List<T> findByEgList(T eg, String... exclude);

	public Pagination findByEg(T eg, boolean anyWhere, Condition[] conds,
			int pageNo, int pageSize, String... exclude);

	public Pagination findByEg(T eg, boolean anyWhere, int pageNo,
			int pageSize, String... exclude);

	public Pagination findByEg(T eg, Condition[] conds, int pageNo,
			int pageSize, String... exclude);

	public Pagination findByEg(T eg, int pageNo, int pageSize,
			String... exclude);

	public Object updateByUpdater(Updater updater);

	public Object updateDefault(Object entity);

	public T save(T entity);

	public Object update(Object o);

	public Object saveOrUpdate(Object o);
	
	public int batchSave(Collection<T> coll);

	public void delete(Object o);

	public T deleteById(Serializable id);

	public List<T> deleteById(Serializable[] ids);

	public T saveAndRefresh(T entity);
	
	public T findUniqueByProperty(String property,Object value);
}
